﻿
//关闭当前页 返回父页面
function closePage(isReload) {
    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
    parent.layer.close(index); //再执行关闭
    if (isReload) {
        parent.search();
    }
}

layui.use(['form', 'layer'], function () {
    var form = layui.form,
        layer = layui.layer;

    $(function () {
        if (app.getRequest('GUID')) {
            initData();
        }
    });

    //初始化表单
    function initData() {
        var fieldData = {
            GUID: app.getRequest('GUID'),
            PostType: "get",
            ActionType: "Project"
        };
        app.loadData("Project.ashx", fieldData, function (data) {
            $('#lblStartDate').text(app.getTDate2(data.StartDate));
            $('#lblEndDate').text(app.getTDate2(data.EndDate));

            if (data.ProjectImagesJson && data.ProjectImagesJson.length > 0) {
                showFileItem(data.ProjectImagesJson, 'tbImagesList', 1, true);
            }
            if (data.ProjectFilesJson && data.ProjectFilesJson.length > 0) {
                showFileItem(data.ProjectFilesJson, 'tbFilesList', 2, true);
            }

            form.render();
        }, function (err) {
            layer.msg('请求失败');
        });
    }
});
